package com.ymatou.app.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.service.ActivityinfoCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;

public class Ts_Activityinfo {

	private static ActivityinfoCall activityCall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取分类首页活动信息接口");
	}

	@Before
	public void caseUp() {
		activityCall = new ActivityinfoCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(activityCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBannerList_001() {
		Logger.start(true, "获取分类首页活动信息成功");
		try {
			activityCall.callService();
			Logger.comment("activityCall send:"
					+ activityCall.getEntityString());
			Logger.comment("activityCall response:"
					+ activityCall.getReturnData());

			Logger.verifyEquals(2, activityCall.getActivityInfo().get("id"),
					"验证活动编号为2");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetBannerList_002() {
		Logger.start(true, "直播的跳转类型为3");
		try {
			activityCall.callService();
			Logger.comment("activityCall send:"
					+ activityCall.getEntityString());
			Logger.comment("activityCall response:"
					+ activityCall.getReturnData());

			Logger.verifyEquals(3, activityCall.getActivityInfo().get("type"),
					"直播的跳转类型为3");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
